package cn.mall.order.service.impl;

import cn.mall.base.utils.AjaxResult;
import cn.mall.order.domain.Order;
import cn.mall.order.mapper.OrderMapper;
import cn.mall.order.mapper.ToolMapper;
import cn.mall.order.service.IToolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

@Service
public class ToolServiceImpl implements IToolService {

    @Autowired
    private ToolMapper toolMapper;

    @Autowired
    private OrderMapper orderMapper;

    @Override
    @Transactional
    public AjaxResult partinsert(Order order) {
        Order order1 = orderMapper.loadById(order.getId());
        if(order1.getUrl() == null){
            return AjaxResult.me().setSuccess(false).setMessage("无当前订单!");
        }
        toolMapper.partInsert(order);
        return AjaxResult.me();
    }
}
